﻿CREATE TABLE [dbo].[HealthKnowledgeDir] (
    [Id]          INT           IDENTITY (1, 1) NOT NULL,
    [Name]        NVARCHAR (50) NULL,
    [BookId]      INT           NULL,
    [ParentId]    INT           NULL,
    [Type]        INT           NOT NULL,
    [Sort]        INT           NULL,
    [RecStatus]   INT           NOT NULL,
    [RecCreateDt] DATETIME      NOT NULL,
    [RecUpdateDt] DATETIME      NULL,
    [RecDeleteDt] DATETIME      NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'健康教育知识目录表', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'主键，自增长', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'Id';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'目录名称', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'Name';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'所属书籍Id', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'BookId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'父目录Id', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'ParentId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'目录类型；1：文章目录(下级只含文章)；2：父目录(下级只含目录)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'Type';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'排序', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'Sort';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录状态, 1：正常；2：删除', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'RecStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录创建时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'RecCreateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录上次修改时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'RecUpdateDt';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'记录删除时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'HealthKnowledgeDir', @level2type = N'COLUMN', @level2name = N'RecDeleteDt';

